<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    .bg{
        width: 300px;
        height: 300px;
        background: darkorange;
    }
    </style>
</head>
<body>
<button>按钮</button>
<div id="box"></div>
<input type="checkbox" name="" id="">
<script src="js/jquery-3.6.0.min.js"></script>
<script>
$(function(){
    console.log($(":input[type=checkbox]".attr('checked')))
    console.log($("#box").attr("id"));
    $("#box").attr("title","123");
    $("#box").attr("data-title","456");
    $("button").click(function(){
        $("#box").attr("class","bg");
    })
})
</script>
</body>
</html>